package jdk7;

/**
 * @author honway.liu
 * @date 2018/4/30 下午9:48
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class Tortoise implements Runnable {

    private int totalStep;

    private int step;

    public Tortoise(int totalStep) {
        this.totalStep = totalStep;
    }

    @Override
    public void run() {
        while (step < totalStep) {
            try {
                Thread.sleep(1000);
                step++;
                System.out.println("乌龟跑了:[" + step + "步]");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }
}
